<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"  %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>First Item事项列表</title>
   	<base href="<%=basePath%>">
    <%@ include file="/main/main_css.jsp" %>
    <%@ include file="/main/main_js.jsp" %>
    <style>
    	.sonItem  span{
    		font-size:15px !important;
    		text-indent: 20px !important;
    		display: block;
    	}
    	.footer {
		    background-color: #cad5f3;
		    height: 135px;
		    padding: 0 20px;
		}
    </style>
</head>
<body>
    <!--  -->
    <div class="all-wrapper">
        <div class="row com-header text-center">
            <span>鹰潭市行政服务中心</span>
        </div>
        <div class="row main-content file-upload">
            <div class="row" >
                <div class="time-count pull-right">
                   <span>剩余</span> <span id="time" class="text-red"></span> <span>秒</span>
                </div>
            </div>
            <div class="row">
            	<div class="col-md-24">
                	<h1>第一批上线事项清单</h1>
                </div>
            </div>
            <div class="row el" style="height:500px;overflow-y: scroll;">
            <c:if test="${firstItemList.size()>0 }">
            <c:forEach var="items" items="${firstItemList }" >
                <div class="col-md-24">
                <!-- 主事项有子事项start -->
            	<div class="fItem" style="padding-bottom:10px;border-bottom:1px solid #ccc;">
	                <c:if test="${items.getItemList().size()>0 }">
		                <span class="list-name" style="color: #938fbc;">${items.getITEMNAME() }  </span> 
	                </c:if>
	                <c:if test="${items.getItemList().size()<=0 }">
	                	<a href="/smartTerminal/getOneItemBszn?itemName=${items.getITEMNAME() }&types=${types }&itemId=${items.getHID() }">
                   			<span class="list-name">${items.getITEMNAME() }  </span> 
		                  	<span class="sm-list-name">办理机构：${items.getNORMACCEPTDEPART() }</span>
                   		</a>
	                </c:if>
              	</div>
                <!-- 主事项end -->
                 <!-- 子事项start -->
                 <c:if test="${items.getItemList()!=null }">
                 <div class="sonItem "   style="display:none;">
                  <c:if test="${items.getItemList().size()>0 }">
           			<c:forEach var="sonItem" items="${items.getItemList() }" >
                  		<a href="/smartTerminal/getOneItemBszn?itemName=${sonItem.getITEMNAME() }&types=${types }&itemId=${sonItem.getHID() }">
                   			<span class="list-name">${sonItem.getITEMNAME() }  </span> 
	                  		<span class="sm-list-name">办理机构：${sonItem.getNORMACCEPTDEPART() }</span>
	                  		<hr style="padding-bottom:10px;border-bottom:1px solid #ccc;"/>
                   		</a>
                  </c:forEach>
                  </c:if>
             	</div>
             	</c:if>
             	<!-- 子事项end -->
                </div>
           </c:forEach>
           </c:if>
        	</div>
          </div>
	       <%-- <div class="col-md-24">
	           <div class="pull-right">
	           <c:if test="${page.currentpage >1 }">
	           	<button class="btn btn-lg btn-warning" type="button" onclick="nextPage(${page.currentpage-1 });">上一页</button>
	           </c:if>
	        <c:if test="${page.currentpage <=1}">
	        	<button class="btn btn-lg btn-warning" type="button">上一页</button>
	        </c:if>
	           <span class="txt-md">${page.currentpage }/${page.currentRow }</span>
	           <c:if test="${page.currentpage<page.currentRow }">
	           	<button class="btn btn-lg btn-warning" type="button" onclick="nextPage(${page.currentpage+1 });">下一页</button>
	           </c:if>	
	           <c:if test="${page.currentpage>=page.currentRow }">
	           	<button class="btn btn-lg btn-warning" type="button">下一页</button>
	           </c:if>
	           </div>
	       </div> --%>
	       <div class="row footer">
	           <a class="btn btn-success btn-lg" href="loginOut" role="button"><i class="fa fa-reply"></i>返回首页</a>
	           <a class="btn btn-primary btn-lg" href="javascript:history.go(-1)" role="button"><i class="fa fa-arrow-left"></i>上一步</a>
	       </div>
    </div>
    <form action="getitembytagid" id="form">
      		<input type="hidden"  name="type"  value="${orItems.getTAG_TYPE()}" >
      		<input type="hidden"  name="tag_id"  value="${orItems.getTAG_ID()}" >
      		<input type="hidden"  name="itemName"  value="" >
      		<input type="hidden"  name="currentpage"  value="${orItems.getCurrentpage() }" id="page" >
      		<input type="hidden"  name="pagesize"  value="${orItems.getPagesize()}" >
      		<input type="hidden"  name="tag_name"  value="${orItems.getTAG_NAME()}" >
      </form>
      <form id="itemForm" action="getOneItemList" method="post">
    	<input type="hidden" id="currentpage" name="currentpage">
    	<input type="hidden" id="pagesize" name="pagesize" value="${page.pageSize}">
    	<input type="hidden" id="itemName" name="itemName" value="${itemName}">
  	 </form>
   <form id="loginOut" action="loginOut"></form>
</body>
<script src="static/js/common.js" type="text/javascript"></script>
<!-- 添加动画 -->
<script type="text/javascript">
	//加入倒计时
	var count =  119;
	function countdown(){
		$("#time").text(count);
		if(count > 0){
			window.setTimeout("countdown()",1000);
			count --;
		}else{
			$("#loginOut").submit();
		}
	}
	countdown();
	//页面加载动画
	var index = layer.load(3, {
	    shade: [0.3,'#000'] //0.1透明度的白色背景  
	});
	setTimeout(function(){
	    layer.close(index);
	},500);
	
	
	$(document).on('click','.fItem',function(){
		$(this).closest('.col-md-24').find('.sonItem').slideToggle();
	});
	
	$(".sonItem").slideUp();
	
	function nextPage(num){
		$("#currentpage").val(num);
		$("#itemForm").submit();
		var index = layer.load(3, {
		    shade: [0.3,'#000'] //0.1透明度的白色背景  
			});
			setTimeout(function(){
			    layer.close(index);
		},2000);
	}
	//页面高度调整
	 var winH = $(document).height();
     var mainH = winH -260;
     $('.main-content').height(mainH);
</script>
</html>
